package Package.Example_3;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class Example_3 {
    public static final void Example_3() throws IOException {
        ServerSocket ss = new ServerSocket(10086);
        Socket accept = ss.accept();
        BufferedReader br = new BufferedReader(new InputStreamReader(accept.getInputStream()));
        BufferedWriter bw = new BufferedWriter(new FileWriter("D:\\insert\\Example.txt"));
        String line;
        while ((line = br.readLine()) != null) {
            bw.write(line);
            bw.newLine();
            bw.flush();
        }
        ss.close();
        bw.close();
    }
}
